﻿<Window x:Class="gsview.Convert"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Convert Pages" Height="270.96" Width="419.424">

    <DockPanel LastChildFill="True">

        <!-- Device viewer/selector -->
        <Grid x:Name="xaml_DeviceGrid" Width="100" Background="DarkGray" DockPanel.Dock="Left" Visibility="Visible" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="0" Grid.Row="0"  Margin="15,0,0,0">
                <Bold>Devices:</Bold>
            </TextBlock>

            <ListView Grid.Column="0" Grid.Row="1" x:Name="xaml_DeviceList" HorizontalAlignment="Stretch" 
                    ScrollViewer.CanContentScroll="False" 
                    Background="White" Margin="10,5,10,10" SelectionMode="Single">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="5,5,0,0" HorizontalAlignment="Left">
                            <TextBlock TextWrapping="Wrap" Text="{Binding DeviceName}" FontFamily="Segoe UI" FontSize="11" />
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>

        <Grid x:Name="xaml_PageGrid" Width="100" Background="DarkGray" DockPanel.Dock="Left" Visibility="Visible">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="0" Grid.Row="0"  Margin="15,0,0,0">
                <Bold>Pages:</Bold>
            </TextBlock>
            <ListView Grid.Column="0" Grid.Row="1"  x:Name="xaml_PageList" HorizontalAlignment="Stretch" 
                    ScrollViewer.CanContentScroll="False" 
                    Background="White" Margin="10,5,10,10">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="5,5,0,0" HorizontalAlignment="Left">
                            <TextBlock TextWrapping="Wrap" Text="{Binding PageString}" FontFamily="Segoe UI" FontSize="11" />
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>

        <!-- Buttons and extra options -->
        <Grid Background="DarkGray" DockPanel.Dock="Left">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid Grid.Column="0" Grid.Row="0" Background="DarkGray">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Grid Background="DarkGray" Grid.Row="0" Grid.Column="0" Margin="30,15,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Button  Grid.Column="0" Grid.Row="0" Width="50" Height="20" Name="xaml_Convert" Click="ConvertClick" Margin="0,0,0,0">
                        <TextBlock>Convert</TextBlock>
                    </Button>
                    <Button  Grid.Column="0" Grid.Row="1" Width="50" Height="20" Name="xaml_Cancel" Click="ConvertCancel" Margin="0,5,0,0">
                        <TextBlock>Cancel</TextBlock>
                    </Button>
                    <Button  Grid.Column="0" Grid.Row="2" Width="50" Height="20" Name="xaml_HelpConvert" Click="HelpConvert" Margin="0,5,0,0">
                        <TextBlock>Help</TextBlock>
                    </Button>
                </Grid>


                <Grid Background="DarkGray" Grid.Row="0" Grid.Column="1" Margin="25,15,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Button  Grid.Column="0" Grid.Row="0" Width="70" Height="20" Name="xaml_AllPages" Click="AllPages" Margin="0,0,0,0">
                        <TextBlock>All Pages</TextBlock>
                    </Button>
                    <Button  Grid.Column="0" Grid.Row="1" Width="70" Height="20" Name="xaml_EvenPages" Click="EvenPages" Margin="0,5,0,0">
                        <TextBlock>Even Pages</TextBlock>
                    </Button>
                    <Button  Grid.Column="0" Grid.Row="2" Width="70" Height="20" Name="xaml_OddPages" Click="OddPages" Margin="0,5,0,0">
                        <TextBlock>Odd Pages</TextBlock>
                    </Button>
                </Grid>
            </Grid>


            <TextBlock Grid.Column="0" Grid.Row="1" Margin="5,10,0,0">
                <Bold>GhostScript Options:</Bold>
            </TextBlock>
            <TextBox x:Name="xaml_options" Grid.Row="2" Background="White" Height="40" Margin="5,5,5,5" Text=""></TextBox>
            <TextBlock Grid.Column="0" Grid.Row="3" Margin="5,10,0,0">
                <Bold>MuPDF Resolution:</Bold>
            </TextBlock>
            <TextBox x:Name="xaml_resolution" Grid.Row="4" Background="White" Margin="5,5,153,19" Text=""
                     PreviewTextInput="PreviewInput"/>
        </Grid>


    </DockPanel>
</Window>
